<?php

namespace App\Modules\Admin\Entities\Property;

use App\Models\Model;

class CheckCategoryModel extends Model
{

    protected $primaryKey='category_id';
    protected $table='check_category';

    public function items()
    {
        return $this->hasMany(CheckItemModel::class, 'category_id')->select(['category_id','item_id','item_name','item_code','data_unit','check_type','options','standard_value']);
    }
    public function getCategoryListByIds($categoryIds){
        return $this->whereIn('category_id',$categoryIds)->get(['category_id','category_name'])->toArray();
    }

}
